UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U0SrwfJXlVTZQk5YgwPOiKwncm6vW77xVXfl73gcwWY='
WHERE
key_id = 'a5fecb973d4386a46e6948ca94c11619ea252eceb619a4d0ccd951f878aa9c64'
AND (
token = 'U0SrwfJXlVTZQk5YgwPOiKwncm6vW77xVXfl73gcwWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)