UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5tABYkqgRtTYexS5+GEvO8IjJacF8mhxm0xcziD4vD0='
WHERE
key_id = '596ac61943720f137d1145d58b84f833f73d621504fb24d7069cc5d91646d93f'
AND (
token = '5tABYkqgRtTYexS5+GEvO8IjJacF8mhxm0xcziD4vD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)