UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8sFS9PjZP1ChidW8FTx0pskjdB9S5PR32lTljIN/0A='
WHERE
key_id = '89069e6a9a011f47b7dc103e534b11745d520f196f3ca6c27deb284a50225254'
AND (
token = '/8sFS9PjZP1ChidW8FTx0pskjdB9S5PR32lTljIN/0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)