UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jvLUZFtHIZ1Gmsin8ddAHzKIXAK79/dYKtel4Ylm4vM='
WHERE
key_id = '0c627c2e70e77ccc0bb28c1b32fc652df8b8ab347a746daa1a46902cc7f5754f'
AND (
token = 'jvLUZFtHIZ1Gmsin8ddAHzKIXAK79/dYKtel4Ylm4vM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)