UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9op2zgzEGFHqJSpJiA5ZeXrzvdkiXAVZsJcRrpchbzE='
WHERE
key_id = '61825de721a1aa62fa990528129811e0d6801f8677052049c8bbe766f38f0f28'
AND (
token = '9op2zgzEGFHqJSpJiA5ZeXrzvdkiXAVZsJcRrpchbzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)