UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oMpf2nRh6wu+tb3LycvgxFRfTFRSO5Ha3njzgrzvlDo='
WHERE
key_id = '4a4a681e5c3cf2fd196a75f9622d786238306d6597a56430d9720c1617786db2'
AND (
token = 'oMpf2nRh6wu+tb3LycvgxFRfTFRSO5Ha3njzgrzvlDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)