UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's7yYKkMWhvRVO/A0cyw0Qe8Ua+VpqVVdng1k1oGKvT4='
WHERE
key_id = '240d11677cba822ae59aa911d48464a121aa36af0f3bf08d503decb0d731c5bf'
AND (
token = 's7yYKkMWhvRVO/A0cyw0Qe8Ua+VpqVVdng1k1oGKvT4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)