UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hJqOZ/ShOkElQnqDdAtfXrMREuSJZ2x9/4Lmr7ss//4='
WHERE
key_id = '144b38c400033dc244507bb96446bee0b47a211a9977cbb207890ef8daafd2d5'
AND (
token = 'hJqOZ/ShOkElQnqDdAtfXrMREuSJZ2x9/4Lmr7ss//4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)