UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K9rxeiQ+W2mQ1uB5+Gad4nD4hGmNmagconpZ4s/g33s=' 
WHERE 
  key_id = '6bc73220158348ae68bf1e3d823142908e678ecf964ad4e116da6b60e0a7fb68' 
  AND (
    token = 'K9rxeiQ+W2mQ1uB5+Gad4nD4hGmNmagconpZ4s/g33s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041