UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2P9Z/N5MYfIwj3MkXxea3I94IIfhJbYdAD7+trL44+o=' 
WHERE 
  key_id = 'dbb261a46469855d30498d4d0ddf0f0679a54b0b5cb5c0f45e1a3583566880ba' 
  AND (
    token = '2P9Z/N5MYfIwj3MkXxea3I94IIfhJbYdAD7+trL44+o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029