UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NSrrARjf6SCeWtRALiwu+l3jJ5vsT+nBs4LhwdQtTIY='
WHERE
key_id = '7a8498413e5c8ae9e437e3a3cd06bb2205f80ea9edbf8b306009840c9056b5ce'
AND (
token = 'NSrrARjf6SCeWtRALiwu+l3jJ5vsT+nBs4LhwdQtTIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)