UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fV3BED5hZe0RPUFkB96bw4XOxdFZPF9Fl4jnnzWbRSs=' 
WHERE 
  key_id = '2d1990e95f1df23d89d5ae5486e2e8be1a136e460c3b1205106cb9ceda936dff' 
  AND (
    token = 'fV3BED5hZe0RPUFkB96bw4XOxdFZPF9Fl4jnnzWbRSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045