UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rqTTn/EQfxxT1ixnjkOgzc5X//8DExmfndXPFUHUF3E='
WHERE
key_id = 'cdb5abfb2312480b1747fe62f11b9fa7d3abeb80d1c6e3bf3b040e7c2152f7ef'
AND (
token = 'rqTTn/EQfxxT1ixnjkOgzc5X//8DExmfndXPFUHUF3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)