UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VdUMlRQqa+aaAK05fruB4LowxJTkB7DMOyLAs84JoCc='
WHERE
key_id = 'fc2da36b378bd320053c91b643738b4dfa9ab4db63c00bf4c2ed9ca25c0d4759'
AND (
token = 'VdUMlRQqa+aaAK05fruB4LowxJTkB7DMOyLAs84JoCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)