UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b8T54N3QCHjddaYFwsKCEmv6xfzn7GeQe/m1G/wF17o=' 
WHERE 
  key_id = '80f28f2b1bd522217dca0986a09ce3bee7d1fe9cad4f4f99ebdba79ad77c7f2c' 
  AND (
    token = 'b8T54N3QCHjddaYFwsKCEmv6xfzn7GeQe/m1G/wF17o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032