UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yoc7K6kAE5vrNo/MLMIm6slfMWBXwvxk3cSKkMpVOJM='
WHERE
key_id = '0140f93896cd1262926b7acac10c5c17414d6aef4933185dcf4b8c87063577d6'
AND (
token = 'yoc7K6kAE5vrNo/MLMIm6slfMWBXwvxk3cSKkMpVOJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)