UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IDgibrqMPb04j7u4SVb/ow9LRV0hLgsnzAIBJu2A2bw='
WHERE
key_id = '2e40afe211d6f552fdb53aacf27f7279d8297d4c24f884135d8bc3d460815db3'
AND (
token = 'IDgibrqMPb04j7u4SVb/ow9LRV0hLgsnzAIBJu2A2bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)