UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JP09Zt4zctSwiiKc+3yuGQrFYvRJkmT9rLMSfipX1bE=' 
WHERE 
  key_id = '3ab10e26e0c2dcec8469dc569e003d1f09e193ab95a272e504d8ae85ff913c0f' 
  AND (
    token = 'JP09Zt4zctSwiiKc+3yuGQrFYvRJkmT9rLMSfipX1bE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046