UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QVpIyFvhkg0eSRnb1NcWeQnwFLCQkg4LsPQSCfZfKEM='
WHERE
key_id = '546fc0cc79115e167980bbb32d14827346861ddf7b5c9a57fc69115ff135aff3'
AND (
token = 'QVpIyFvhkg0eSRnb1NcWeQnwFLCQkg4LsPQSCfZfKEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)