UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'thy1OhZlg1Np8IMLTIptfAgSHEw6Js0b4zEnakg1uPo=' 
WHERE 
  key_id = '729321b65db2689942cb8569c0707b42dc64b5ec03d4c3f0db4edee6e026479a' 
  AND (
    token = 'thy1OhZlg1Np8IMLTIptfAgSHEw6Js0b4zEnakg1uPo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047