UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iq5He8Ez7O6KFAJhEoKwZKnD3LfMJ7+1NEgR7UQFxmg=' 
WHERE 
  key_id = 'f8f21989c88a61066c6713b8326d4e0a6f61a916b6ec16aecd4b42ae1652793b' 
  AND (
    token = 'iq5He8Ez7O6KFAJhEoKwZKnD3LfMJ7+1NEgR7UQFxmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00066