UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'COa4j/ZnqHMXcoELKZQTiv54/N2DZBux9fjBB8n50/w='
WHERE
key_id = 'f2dce092001d365260af3786b90d220009d583a9ceb3c8c13e1becd6971791ea'
AND (
token = 'COa4j/ZnqHMXcoELKZQTiv54/N2DZBux9fjBB8n50/w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)