UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hZ62AFae4dG6g3EAikXR6f6YHnYjGMFq1XW9pMqJkuY='
WHERE
key_id = '05ca832a7500077669eadd771ada9496c556c2337f0a8b6301223e7a6851ed9b'
AND (
token = 'hZ62AFae4dG6g3EAikXR6f6YHnYjGMFq1XW9pMqJkuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)