UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DkDCUdh45TfsrMMV+keaNGVQJIZIwz3s5cD/i3mFLzo=' 
WHERE 
  key_id = 'e3768c0bfb4fbcb9f93ee74656f82b65ed1120c06d8f0dedf3edb2369119afcd' 
  AND (
    token = 'DkDCUdh45TfsrMMV+keaNGVQJIZIwz3s5cD/i3mFLzo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032