UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XJhPwCR6U6syHMtdlu/JqoWdOJ9068dKrbNowCxHrWM=' 
WHERE 
  key_id = '705b1f4f2b8c16001279d1f1bb8d005bd522ac60f2f4f2830aab7dd06a991914' 
  AND (
    token = 'XJhPwCR6U6syHMtdlu/JqoWdOJ9068dKrbNowCxHrWM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033