UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zaJtGoKeJUNFKRqu4cP+LoomvKUobHyGdpkCrvts9tY='
WHERE
key_id = '13a19fb77b522949e5cd055eec9c9cd8665806190171dafbed690eb61e3818be'
AND (
token = 'zaJtGoKeJUNFKRqu4cP+LoomvKUobHyGdpkCrvts9tY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)