UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjc5G5Jg9sE0tFWdcRGl7jW0Qzzl05wgo9CxQfFrako='
WHERE
key_id = '7aea3b4e141923ec7cf3cb54ad08ab20921ad0a868caefcec21c3b9833b7432e'
AND (
token = 'pjc5G5Jg9sE0tFWdcRGl7jW0Qzzl05wgo9CxQfFrako='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)