UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CVX4nDImi//nARqOvRpxMGLlZ1/gWq3BuMFeBqJnFAw='
WHERE
key_id = '74c14b5ce4fcb18121e50f96b11666030426a1bb974278524eb7911077c22825'
AND (
token = 'CVX4nDImi//nARqOvRpxMGLlZ1/gWq3BuMFeBqJnFAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)