UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aL6daDfbqk9qdChRB8d3G0NdHisDhQE6Dz2I/FeYx3g=' 
WHERE 
  key_id = 'c4cb4bbea3aeecc8271fd77bb3757cc6b21d41e99f84e9fec115a1afe6a9320a' 
  AND (
    token = 'aL6daDfbqk9qdChRB8d3G0NdHisDhQE6Dz2I/FeYx3g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031