UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tGqo6vG2ktgRrbkBzP37PdMqdXUPlcT7b77ZJn3qv1k='
WHERE
key_id = '255665203492e8b861b026e6d822bb9f9d171e7e2dfd5b6b2f02742a9e736dec'
AND (
token = 'tGqo6vG2ktgRrbkBzP37PdMqdXUPlcT7b77ZJn3qv1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)