UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kLrKSXxsFuNSAQtDqu+0Nz8IpJmRSOfu4PgWbbnyObs=' 
WHERE 
  key_id = 'b8638f00e7be022b2e17679b72810f75a3378ab83b8d46e524ef78cde0ddd3e2' 
  AND (
    token = 'kLrKSXxsFuNSAQtDqu+0Nz8IpJmRSOfu4PgWbbnyObs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016