UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rqUqlKuVf+ZGRnNSVUAHatMEZF3U48eSOpoQvObiZhg='
WHERE
key_id = 'd619cb9548f52ad325e711948bc2ba8a7d2e44bf1fa14a5c843cef27f3ceb26c'
AND (
token = 'rqUqlKuVf+ZGRnNSVUAHatMEZF3U48eSOpoQvObiZhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)