UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kvZ2GKbATAoM4/UswSLtPovWQWlLHw/ehn1GRDv4llQ=' 
WHERE 
  key_id = '149a6e78c7919235e0a59769aa6a9681c2df3f8b1725f14b60cd5ed922ebe244' 
  AND (
    token = 'kvZ2GKbATAoM4/UswSLtPovWQWlLHw/ehn1GRDv4llQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073