UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9aWxjc1RqQLsk0Su0b8NwvJaKNrfFVXT0ADPKPuYq5g='
WHERE
key_id = '36fc284cd7fe9a62ee5af6b5dea71fbfe6db4ead0841757f5ecf87a6f65839a1'
AND (
token = '9aWxjc1RqQLsk0Su0b8NwvJaKNrfFVXT0ADPKPuYq5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)