UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6pPq3roTwl2SybMdBn37+vpKaJ+lY+6pkBDlNAEUxAE='
WHERE
key_id = '5594bbfdca27b0a9294611bb674b7275286e58ecc78106503279c6fb04d097c2'
AND (
token = '6pPq3roTwl2SybMdBn37+vpKaJ+lY+6pkBDlNAEUxAE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)