UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'laJT1cVZ/Sl0DU/LQj2Wo4fK4LlL9eLthFko9VXcMeM=' 
WHERE 
  key_id = 'b3036eef09bf173c26476ea69ebb5f78e557b5909896392de8ef5329e10c8879' 
  AND (
    token = 'laJT1cVZ/Sl0DU/LQj2Wo4fK4LlL9eLthFko9VXcMeM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036