UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aNfTp5yXc1TLWqeJN0DlgrmMwIQJTSle7x8MOTLZddQ='
WHERE
key_id = '8f01e24e94ca424a79c2e921af9f7def62d97fe6db8bf882f5b6eac11f263a92'
AND (
token = 'aNfTp5yXc1TLWqeJN0DlgrmMwIQJTSle7x8MOTLZddQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)