UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g9mcVLRKvBTE8t/psZ7g21S0TiYO9ZpTUFZQcjsMFqc=' 
WHERE 
  key_id = 'a3dd9468e27ac909f5a72e4bc5ee2abf1f8521dc2cb8597243bea38d029fd9a1' 
  AND (
    token = 'g9mcVLRKvBTE8t/psZ7g21S0TiYO9ZpTUFZQcjsMFqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038