UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B7HxzsKgR6SLEXE73i2l/r79E3SUETsPF6iQNBErTm4=' 
WHERE 
  key_id = '4fe8cce2689738e5ba3c5932b2400931bfb88da93588ac7ac79ada38db16f97a' 
  AND (
    token = 'B7HxzsKgR6SLEXE73i2l/r79E3SUETsPF6iQNBErTm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022