UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YBuTM6sRZb27NBxTbqvfto8lXAdqpPCUkMib2s4T2wY='
WHERE
key_id = '84f777de6bbd68ff5c62e872ea3d3b40cddc4b3f00b1b9774eae798cb298959a'
AND (
token = 'YBuTM6sRZb27NBxTbqvfto8lXAdqpPCUkMib2s4T2wY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)