UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '203UKzNWkJWZrYsZXv/S8VAxqcJt/suqFVFzQCI+75Y='
WHERE
key_id = 'ba016c266bd8645b0b2e3d7a8e60464277af94a1b2f35c4a474e92560f052fe6'
AND (
token = '203UKzNWkJWZrYsZXv/S8VAxqcJt/suqFVFzQCI+75Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)