UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LKa4p14pdIf/B+xI6d9nDWlFjBtPm8dCbQiLPV0CYsk='
WHERE
key_id = 'e2287c4c8edd207044be14ef26162f5072efeb93628e7d68c0629ad10acdfbb0'
AND (
token = 'LKa4p14pdIf/B+xI6d9nDWlFjBtPm8dCbQiLPV0CYsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)