UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RGA0H1QKU3NoWlqdM9M2du0PAS/5N10R7PfkCA9F288='
WHERE
key_id = 'fff44083e33f3a3cb1e34574a13cdd7f557231529d895d55ba1dbd10b1e33e32'
AND (
token = 'RGA0H1QKU3NoWlqdM9M2du0PAS/5N10R7PfkCA9F288='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)