UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6LPKaeXVxd8w++oQlswqm/D44z/2sGa8TG5JHrV004A=' 
WHERE 
  key_id = 'b0b35756e009960769810bec4db36a96a580aebd56e8e11e06a8df42025c7b1d' 
  AND (
    token = '6LPKaeXVxd8w++oQlswqm/D44z/2sGa8TG5JHrV004A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033