UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Kl+IwE2p7bUZNWqWSHF+VGJexwe8/5lzDQCjxZ80FDo=' 
WHERE 
  key_id = 'ada96e0bfc538f7344e5bc88a8fa211b2d106789f33f6c1b6568e7712a93187b' 
  AND (
    token = 'Kl+IwE2p7bUZNWqWSHF+VGJexwe8/5lzDQCjxZ80FDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029