UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/eICE6ogqeNF1ppKc2sIiRauUQMeymJE8o6K8YS1K8s='
WHERE
key_id = '0e8ce824f079e9ea66e5f3bd8e5307acb70abd62431cf14e85fc8e18d9329744'
AND (
token = '/eICE6ogqeNF1ppKc2sIiRauUQMeymJE8o6K8YS1K8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)