UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TFcm+i7GFCrP/nAVSu0ZMa9CwNr8sHrztguzEVXoERA='
WHERE
key_id = '5362ea8439b99caba55d1907eba0c7afc294e3902c374169cbc24a842895ecb0'
AND (
token = 'TFcm+i7GFCrP/nAVSu0ZMa9CwNr8sHrztguzEVXoERA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)